function debounce(fn, delay) {
    let timer;
    return () => {
        let _this = this;
        let args = arguments
        clearTimeout(timer)
        timer = setTimeout(() => {
            fn.apply(_this, args)
        }, delay)
    }
}
function throttle(fn, delay) {
    let timer;
    return () => {
        let _this = this;
        let args = arguments
        timer = setTimeout(() => {
            fn.apply(_this, args)
            clearTimeout(timer)
        }, delay)
    }
}